<?php

declare(strict_types=1);

namespace App\Amqp\Producers;

use Hyperf\Amqp\Annotation\Producer;
use Hyperf\Amqp\Message\ProducerMessage;

use function Hyperf\Support\env;
#[Producer(exchange: "price", routingKey: "price")]
class FundBalanceProducer extends ProducerMessage
{

    public function __construct($balance)
    {
        // 设置不同 pool
        //$this->poolName = 'pool';

        $this->payload = [
            'opt' => [
                'from' => env('APP_NAME', 'yaoli')
            ],
            'data' => [
                'fund_balance' => $balance
            ],
        ];
    }
}
